using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Details_aspx : System.Web.UI.Page {

    void Page_Load(object sender, EventArgs e) {
        
        if (Request.Params["name"] != null)
        {
            Page.Title = Application["AlbumsTitle"].ToString() +"|"+ Request.Params["name"].ToString();
        }
        else
        {
            Page.Title = Application["AlbumsTitle"].ToString();
        }
		Page.MaintainScrollPositionOnPostBack = true;
        if (!IsPostBack) {
            try
            {
                int i = Convert.ToInt32(Request.QueryString["Page"]);
                if (i >= 0) FormView1.PageIndex = i;
            }
            catch (Exception ex)
            {

            }
        }
    }

    protected void FormView1_PageIndexChanging(object sender, FormViewPageEventArgs e)
    {
        if (e.NewPageIndex == -1)
        {
            e.Cancel = true;
            FormView1.PageIndex = FormView1.PageCount - 1;
            FormView1.Page.Focus();
        }

        else if (FormView1.PageCount <= e.NewPageIndex)
        {
            e.Cancel = true;
            FormView1.PageIndex = 0;
            FormView1.Page.Focus();
        }

        else
        {
            FormView1.PageIndex = e.NewPageIndex;
        }

        ObjectDataSource1.Select();      
    }
}